home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
RCSC.ZIP
/
LIB51
/
STRNCPY.C
< prev
next >
Wrap
C/C++ Source or Header
|
1997-01-12
|
267b
|
15 lines
/*
** copy n characters from sour to dest (null padding)
*/
strncpy(dest, sour, n) char *dest, *sour; int n; {
char *d;
d = dest;
while(n-- > 0) {
if(*d++ = *sour++) continue;
while(n-- > 0) *d++ = 0;
}
*d = 0;
return (dest);
}